/**
 * 
 */
package br.com.skynix.tcmc.controller.configuracao.servicos.planos;

import java.util.List;

import javax.annotation.Resource;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;

import org.springframework.stereotype.Controller;

import br.com.skynix.tcmc.base.managedbeans.AbstractCRUDManagedBean;
import br.com.skynix.tcmc.base.spring.IServiceAuditavel;
import br.com.skynix.tcmc.model.servico.Plano;
import br.com.skynix.tcmc.model.servico.TipoPlano;
import br.com.skynix.tcmc.service.configuracao.servicos.planos.PlanoService;
import br.com.skynix.tcmc.service.configuracao.servicos.tipos_planos.TipoPlanoService;

/**
 * @author davi
 * 
 */
@ManagedBean
@RequestScoped
@Controller
public class PlanoMB extends AbstractCRUDManagedBean<Plano> {
	@Resource
	private PlanoService planoService;

	@Resource
	private TipoPlanoService tipoPlanoService;

	public PlanoMB() {
		setModeloPesquisa(new Plano());
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * br.com.skynix.tcmc.base.managedbeans.AbstractCRUDManagedBean#getService()
	 */
	@Override
	protected IServiceAuditavel<Plano> getService() {
		return planoService;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see br.com.skynix.tcmc.base.managedbeans.AbstractCRUDManagedBean#
	 * getPathParaModuloCRUD()
	 */
	@Override
	protected String getPathParaModuloCRUD() {
		return formatPath("configuracao/servicos/planos/plano_crud_view");
	}

	public List<TipoPlano> getListaTipoPlano() {
		return tipoPlanoService.listarTodos();
	}
}
